package edu.gatech.cs2340.aperturescience.backend.task;

import java.util.Date;
import java.util.List;

import android.location.Location;

/**
 * TasksDataSource interface contains the essential methods to manage a Tasks database
 * 
 * @author Aperture Science
 * @3/12/2012
 */
public interface TasksDataSource
{
	/**
	 * Opens the database
	 */
	public abstract void open();

	/**
	 * Closes the database
	 */
	public abstract void close();

	/**
	 * createTask creates a task containing the given information
	 */
	public abstract void createTask(int userID, String name,
			String description, String category, Location location, Date dueDate);

	/**
	 * createCategory initiates a category from the task creation menu
	 * - Only applicable if in the "All" Category
	 */
	public abstract void createCategory(int userID, String category);

	/**
	 * getAllTasks returns a list of all existing Tasks
	 */
	public abstract List<Task> getAllTasks(int userID);

	/**
	 * getTaskByName returns a specific task with name matching the given String
	 */
	public abstract Task getTaskByName(String name);

	/**
	 * getTaskByID returns a specific task with uniqueID matching the given int
	 */
	public abstract Task getTaskByID(int uniqueID);

	/**
	 * getCategoryTasks returns a list of tasks under the specified Category
	 */
	public abstract List<Task> getCategoryTasks(int userid, String category);

	/**
	 * getTasksByDate returns all tasks within the specified Data parameter
	 */
	public abstract List<Task> getTasksByDate(Date dueDate);

	public abstract void setCompleted(int taskID, boolean completed);

	/**
	 * deleteTask delets a task matching the given uniqueID
	 */
	public abstract void deleteTasks(int[] uniqueID);

}
